/**
 * Licensee: DuKe TeAm
 * License Type: Purchased
 */
package ormsamples;

import org.orm.*;
public class CreateBasededatosv5Data {
	public void createTestData() throws PersistentException {
		PersistentTransaction t = orm.Basededatosv5PersistentManager.instance().getSession().beginTransaction();
		try {
			orm.DAOFactory lDAOFactory = orm.DAOFactory.getDAOFactory();
			orm.dao.Trp_regionDAO lormTrp_regionDAO = lDAOFactory.getTrp_regionDAO();
			orm.Trp_region lormTrp_region = lormTrp_regionDAO.createTrp_region();
			// TODO Initialize the properties of the persistent object here, the following properties must be initialized before saving : trp_provincia, re_des_region
			lormTrp_regionDAO.save(lormTrp_region);
			orm.dao.Trp_provinciaDAO lormTrp_provinciaDAO = lDAOFactory.getTrp_provinciaDAO();
			orm.Trp_provincia lormTrp_provincia = lormTrp_provinciaDAO.createTrp_provincia();
			// TODO Initialize the properties of the persistent object here, the following properties must be initialized before saving : trp_colegio, region, pr_des_prov
			lormTrp_provinciaDAO.save(lormTrp_provincia);
			orm.dao.Trp_sexoDAO lormTrp_sexoDAO = lDAOFactory.getTrp_sexoDAO();
			orm.Trp_sexo lormTrp_sexo = lormTrp_sexoDAO.createTrp_sexo();
			// TODO Initialize the properties of the persistent object here, the following properties must be initialized before saving : trp_alumno, se_des_sexo
			lormTrp_sexoDAO.save(lormTrp_sexo);
			orm.dao.Trp_cursoDAO lormTrp_cursoDAO = lDAOFactory.getTrp_cursoDAO();
			orm.Trp_curso lormTrp_curso = lormTrp_cursoDAO.createTrp_curso();
			// TODO Initialize the properties of the persistent object here, the following properties must be initialized before saving : trp_alumno1, colegio, nivel_id_nivel, cu_curso
			lormTrp_cursoDAO.save(lormTrp_curso);
			orm.dao.Trp_colegioDAO lormTrp_colegioDAO = lDAOFactory.getTrp_colegioDAO();
			orm.Trp_colegio lormTrp_colegio = lormTrp_colegioDAO.createTrp_colegio();
			// TODO Initialize the properties of the persistent object here, the following properties must be initialized before saving : trp_curso, provincia, socio_eco, tipo_coleg, co_nombre
			lormTrp_colegioDAO.save(lormTrp_colegio);
			orm.dao.Trp_alumnoDAO lormTrp_alumnoDAO = lDAOFactory.getTrp_alumnoDAO();
			orm.Trp_alumno lormTrp_alumno = lormTrp_alumnoDAO.createTrp_alumno();
			// TODO Initialize the properties of the persistent object here, the following properties must be initialized before saving : trp_datos, curso, sexo_id_cod, al_fecha_nac, al_nombre
			lormTrp_alumnoDAO.save(lormTrp_alumno);
			orm.dao.Trp_nivelDAO lormTrp_nivelDAO = lDAOFactory.getTrp_nivelDAO();
			orm.Trp_nivel lormTrp_nivel = lormTrp_nivelDAO.createTrp_nivel();
			// TODO Initialize the properties of the persistent object here, the following properties must be initialized before saving : trp_curso, ni_des_nivel
			lormTrp_nivelDAO.save(lormTrp_nivel);
			orm.dao.Trp_tipo_colegDAO lormTrp_tipo_colegDAO = lDAOFactory.getTrp_tipo_colegDAO();
			orm.Trp_tipo_coleg lormTrp_tipo_coleg = lormTrp_tipo_colegDAO.createTrp_tipo_coleg();
			// TODO Initialize the properties of the persistent object here, the following properties must be initialized before saving : trp_colegio, tc_des_tipo
			lormTrp_tipo_colegDAO.save(lormTrp_tipo_coleg);
			orm.dao.Trp_socio_ecoDAO lormTrp_socio_ecoDAO = lDAOFactory.getTrp_socio_ecoDAO();
			orm.Trp_socio_eco lormTrp_socio_eco = lormTrp_socio_ecoDAO.createTrp_socio_eco();
			// TODO Initialize the properties of the persistent object here, the following properties must be initialized before saving : trp_colegio, so_des_socio_e
			lormTrp_socio_ecoDAO.save(lormTrp_socio_eco);
			orm.dao.Trp_datosDAO lormTrp_datosDAO = lDAOFactory.getTrp_datosDAO();
			orm.Trp_datos lormTrp_datos = lormTrp_datosDAO.createTrp_datos();
			// TODO Initialize the properties of the persistent object here, the following properties must be initialized before saving : alumno_id_rut, da_porcen_grasa, da_masa_cor, da_cintura, da_cuello, da_estatura, da_peso, da_edad
			lormTrp_datosDAO.save(lormTrp_datos);
			t.commit();
		}
		catch (Exception e) {
			t.rollback();
		}
		
	}
	
	public static void main(String[] args) {
		try {
			CreateBasededatosv5Data createBasededatosv5Data = new CreateBasededatosv5Data();
			try {
				createBasededatosv5Data.createTestData();
			}
			finally {
				orm.Basededatosv5PersistentManager.instance().disposePersistentManager();
			}
		}
		catch (Exception e) {
			e.printStackTrace();
		}
	}
}
